package demo1;


import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.Random;

class A {
    public String name;

    public A(String name) {
        this.name = name;
    }

    /*@Override
    public String toString() {
        return "name :" + name;
    }*/

    @Override
    public String toString() {
        return super.toString();
    }
}

public class Test {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(123);
        list.add(678);
        //迭代器
        ListIterator<Integer> it = list.listIterator();
        while (it.hasNext()) {
            System.out.print(it.next() + " ");
        }
    }
}
